<template>
  <div id="sailing-scan">
    <div class="row row-1"></div>
    <div class="row row-2">
      <div class="row">
        <!--        <div class="declare">-->
        <!--          <p class="ellipsis">机动雷达</p>-->
        <!--        </div>-->
      </div>
    </div>
    <div class="row row-3">
      <iframe id="iframe-sailing-scan" :src="src" frameborder="0"></iframe>
    </div>
  </div>
</template>

<script>
import { technovoLidarLogin } from "../../axios/api";

export default {
  data() {
    return {
      src: null
    };
  },
  methods: {
    initMounted() {
      technovoLidarLogin(res => {
        localStorage.setItem("Token", res.data.token);
        localStorage.setItem("customerCode", res.data.customerCode);
        this.src = "http://sjz.lcgufen.com/kczg/system/html/sailing-scan.html";
        let iframe = document.getElementById("iframe-sailing-scan");
        iframe.contentWindow.postMessage({
          data: res.data.customerCode + "/" + res.data.token
        });
      });
    }
  },
  mounted() {
    this.initMounted();
  }
};
</script>

<style lang="stylus" scoped>
#sailing-scan
  position relative
  width 100%
  height 100%

  > .row-1
    height 120px

  > .row-2
    height 59px
    padding 30px 0

  > .row-3
    height 775px

    > iframe
      position relative
      width 100%
      height 100%
</style>
